package me.idashu.attg.service;

import java.util.List;
import java.util.Map;

import me.idashu.attg.domain.GoodsEntity;
import me.idashu.attg.persistence.GoodesMapper;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class GoodesService {

	@Autowired
	private GoodesMapper goodsMapper;

	public void insertGoods(GoodsEntity goodsEntity) {
		goodsMapper.insertGoodsEntityInfo(goodsEntity);
	}

	public List<GoodsEntity> findGoodsByPage(Map<String, Object> map) {
		List<GoodsEntity> goods = goodsMapper.findGoodsByPage(map);
		return goods;
	}

	public int findCountGoodsByPage(GoodsEntity goodsEntity) {
		int count = goodsMapper.findCountGoodsByPage(goodsEntity);
		return count;
	}

	public GoodsEntity findGoodById(long id) {
		GoodsEntity goods = goodsMapper.findGoodById(id);
		return goods;
	}

	public void deleteGoodsById(long id) {
		goodsMapper.deleteGoodsById(id);
	}

	public List<GoodsEntity> findAllGoodsByPage(Map<String, Object> map) {
		List<GoodsEntity> goods = goodsMapper.findAllGoodsByPage(map);
		return goods;
	}

	public int findCountAllGoodsByPage(Map<String, Object> map) {
		int count = goodsMapper.findCountAllGoodsByPage(map);
		return count;
	}

	public List<GoodsEntity> searchGoodsEntity(GoodsEntity goodsEntity) {
		List<GoodsEntity> goods = goodsMapper.searchGoodsEntity(goodsEntity);
		return goods;
	}

	public List<GoodsEntity> findGoodesByShopId(long shopId) {
		List<GoodsEntity> goodses = goodsMapper.findGoodesByShopId(shopId);
		return goodses;
	}
}
